import { useRoutes } from "react-router-dom";
import Hooks from "./Hooks/Hooks";
import ContextParent from "../pages/案例/Hooks/context/ContextParent";
const Routes = () => {
  return useRoutes([
    {
      path: '/ooks',
      element: <Hooks />,
      children: [
        {
          path: 'useState',
          element: <DemoState1 />,
        },
        {
          path: 'useEffect',
          element: <DemoEffect />
        },
        {
          path: 'useRef',
          element: <UseRefCurrent />
        },
        {
          path: 'context',
          element: <ContextParent />
        },
        {
          path: 'useMemo',
          element: <UseMemoParent />
        },
        {
          path: 'useCallback',
          element: <UseCallbackParent />
        },
      ]
    },
    {
      path: '/homework',
      element: <HomeWork />,
      children: [
        {
          // path: '', // index属性
          index: true,
          element: <TodoListDemo />
        },
        {
          path: 'todolist',
          element: <TodoList />
        }
      ]
    },

    {
      path: '/lazyComp',
      element: <DemoLazyIndex />
    },

    {
      path: '/pureFunc',
      element: <DemoLazyIndex />
    },
    {
      path: '/login',
      element: <Login />
    },
    {
      path: '*',
      element: <NotFount />
    }
  ])
}

export default Routes